Skip to content

Conversation

nviennot
Copy link

@nviennot nviennot commented Jan 8, 2022

It's useful for opening various files on the host.

For example:

let mt file = open("file.bin\0", nr::open::RW_TRUNC_BINARY).unwrap();
file.write_all(b"Some binary content").unwrap();

OpenOCD will write the content in file.bin on the host, provided monitor arm semihosting_fileio enable is in the gdb config

@nviennot nviennot requested a review from a team as a code owner January 8, 2022 03:49
It's useful for opening various files on the host.

For example:

    let mut file = open("file.bin\0", nr::open::RW_TRUNC_BINARY).unwrap();
    file.write_all(b"Some binary content").unwrap();
@nviennot nviennot changed the title Export semihistory::hio::open() Export semihosting::hio::open() Jan 8, 2022
@jonathanpallant
Copy link
Contributor

Sorry we dropped this one.

Is it still relevant? If so, consider taking a &CStr as the handle, which is the string-slice type for null terminated strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants